import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
const router=createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path:'/',
            name:'/',
            redirect:'/login'
        },
        {
            path:'/login',
            name:'login',
            component:()=>import('../views/login.vue'),
            meta:{
                title:'登录'
            }
        },
        {
            path:'/index',
            name:'index',
            component:()=>import('../views/index.vue'),
            redirect:'/index/user',
            meta:{
                title:'我的工作台'
            },
            children:[
                {
                    path:'user',
                    name:'user',
                    component:()=>import('../views/user/useradmin.vue'),
                    meta:{
                        title:'用户管理'
                    }
                },
                {
                    path:'role',
                    name:'role',
                    component:()=>import('../views/role/roleadmin.vue'),
                    meta:{
                        title:'角色管理'
                    }
                },
                {
                    path:'dept',
                    name:'dept',
                    component:()=>import('../views/dept/deptadmin.vue'),
                    meta:{
                        title:'部门管理'
                    }
                },
                {
                    path:'UserMsg',
                    name:'UserMsg',
                    component:()=>import('../views/UserMsg/UserMsg.vue'),
                    meta:{
                        title:'修改个人信息'
                    }
                }
            ]
        },
         
        {
            path:'/sys',
            name:'sys',
            component:()=>import('../views/sys.vue'),
            meta:{
                title:'系统设置'
            },
            children:[
                {
                    path:'changePWD',
                    name:'changePWD',
                    component:()=>import('../views/system/changePWD.vue'),
                    meta:{
                        title:'修改密码'
                    }
                }
            ]
        }
    ]
})
export default router;